package com.tjcm.tjcminspectmanager;

import com.tjcm.tjcminspectmanager.model.User;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import cn.emagsoftware.ui.staticmanager.StaticManager;

public class TaskSelectActivity extends BaseActivity
{
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        if (!LoginActivity.IS_APP_RUNNING)
        {
            StaticManager.restartAppWhenDalvikRecycled(this, LoginActivity.class);
            return;
        }
        final User user = (User) getIntent().getSerializableExtra("USER");
        setContentView(R.layout.taskselect);

        Button pending = (Button) findViewById(R.id.pending);
        Button process = (Button) findViewById(R.id.process);
        Button cancel = (Button) findViewById(R.id.cancel);

        pending.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v)
            {
                // TODO Auto-generated method stub
                Intent intent = new Intent(TaskSelectActivity.this, TaskPendingListActivity.class);
                intent.putExtra("USER", user);
                startActivity(intent);
            }
        });
        process.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v)
            {
                // TODO Auto-generated method stub
                Intent intent = new Intent(TaskSelectActivity.this, TaskProcessListActivity.class);
                intent.putExtra("USER", user);
                startActivity(intent);
            }
        });
        cancel.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v)
            {
                // TODO Auto-generated method stub
                finish();
            }
        });
    }

}